<?php
$d=dir("./");
echo "<p align=\"center\">";
while($entry=$d->read()){
	if(!is_file($entry))
	continue;
	list($filenm,$fileext)=explode(".",$entry,2);
	$linknm="";
	$fp=fopen($entry,"r");
	while($buffer=fgets($fp,4096)){
		$buffer=trim($buffer);
		if(preg_match("/title*=*\"/",$buffer)){
			eval($buffer);
			$linknm=$title;
			break;
		}
	}
	fclose($fp);
	if($entry == basename($_SERVER['PHP_SELF']))
	echo "$linknm";
	else
	echo "<a href=\"$entry\">$linknm</a>";
	echo " ";
}
$d->close();
echo "</p>";
?>